﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        $("#id").val($.request('keyValue'));
        $("#username").val($.request('realName'));
        //$("#password").val($.request('password'));
    });
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
      var postData = $("#form1").formSerialize();
        postData["userPassword"] = $("#newpassword").val();
        postData["keyValue"] = keyValue;
        //if (postData["userPassword"] != $("#oldpassword").val($.request('password'))) {
        //    alert("新密码与旧密码相同，请重新输入");
        //} else {
            $.submitForm({
                url: "/SystemManage/User/SubmitRevisePassword",
                param: postData,
                success: function () {
                    $.loading(false)
                }
            });
        }
    //}
</script>
<form id="form1">
    <div style="padding-top: 30px; margin-right: 40px;">
        <table class="form">
            <tr>
                <th class="formTitle">id</th>
                <td class="formValue">
                    <input id="id" name="id" readonly type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">姓名</th>
                <td class="formValue">
                    <input id="username" name="username" readonly type="text" class="form-control" />
                </td>
            </tr>
           @* <tr>
                <th class="formTitle">旧密码</th>
                <td class="formValue">
                    <input id="password" name="password" readonly type="text" class="form-control" />
                </td>

            </tr>*@
             <tr>
                <th class="formTitle">新密码</th>
                <td class="formValue">
                    <input id="newpassword" name="newpassword" type="password" class="form-control required" placeholder="请输入新密码" />
                </td>
            </tr>
        </table>
    </div>
</form>

